using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class ShopScript : MonoBehaviour {
	
	public MainDisplay _display;
	public SimpleImageDisplay _image;
	public SelectionMenu _menu;
	public SimpleMenuItem [] menuItem;
	public ShopItemScript [] _menuScript;
	private Shop _shop;
	public MoveToGame _moveToGame;
	
	public void BootStrap(Shop shop){
		
		_shop = shop;
		_moveToGame._shop = shop;
		_image._image = GroundManager.Instance.GetRandomImage();

		int count = 0;
		foreach (KeyValuePair<Item, int> pair in ItemManager.Instance.GetShoppPriceList(_menuScript.Length)) {
			_menuScript[count].BootStrap( pair.Key, (double)pair.Value, shop );
			count++;
		}
		
		_display.Render = false;
		
	}
	
	public void PopUp() {
		
		GameKeyListener.Instance.ActiveMenus[_shop.InShopPlayer.ControlScheme] = _menu;
		_display.Render = true;
		
	}
	
	public void PopDown() {
		
		GameKeyListener.Instance.ActiveMenus[_shop.InShopPlayer.ControlScheme] = PlayerManager.Instance;
		_display.Render = false;
		
	}
	
	
}
